import React from 'react'
import './video_hint.css'

class VideoHint extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            show: true,
            timer: null,
        }
    }

    componentDidMount() {
        let timer = setTimeout(() => {
            this.hide()
        }, 6000)
        this.setState({
            timer: timer,
        })
    }

    componentWillUnmount() {
        let timer = this.state.timer
        timer && clearTimeout(timer)
    }

    hide = () => {
        this.setState({
            show: false,
        })
    }

    render() {
        if (this.state.show === false) return null
        return (
            <div className='video-hint'>
                <p className='slide-left'>本站部分视频自于网络，如侵犯到您的权益，请及时通知我们，我们将及时的处理。</p>
            </div>
        )
    }
}

export default VideoHint